package com.ayoka.parenting.ui.coach.applycoachcondition;

import com.ayoka.parenting.R;
import com.ayoka.parenting.bean.ApplyCoachConditionBean;
import com.ayoka.parenting.bean.MyProfitBean;
import com.ayoka.parenting.interf.SimpleRequestCallback;
import com.ayoka.parenting.mvp.BasePresenterImpl;
import com.jincp.common.utils.UIUtils;
import com.tencent.openqq.protocol.imsdk.head;

/**
 * @ProjectName: MVPPlugin.
 * @ClassName: ApplyCoachConditionPresenter.
 * @Description: .
 * @Author: jincp.
 * @CreateDate: 2019/10/10 18:17.
 */
public class ApplyCoachConditionPresenter extends BasePresenterImpl<ApplyCoachConditionContract.View> implements ApplyCoachConditionContract.Presenter{

    private ApplyCoachConditionModel model;

     public ApplyCoachConditionPresenter() {
        model = new ApplyCoachConditionModel();
     }

    @Override
    public void getMyInvitedUserCount() {
        mView.get().showWaitDialog(UIUtils.getString(R.string.loading));
        model.getMyInvitedUserCount(this, new SimpleRequestCallback<ApplyCoachConditionBean>() {
            @Override
            public void onSuccess(ApplyCoachConditionBean data) {
                if (!isAttached()) return;
                mView.get().hideWaitDialog();
                mView.get().configMyInvitedUserCountData(data);
            }

            @Override
            public void onFailure(int errCode, String errMsg) {
                if (!isAttached()) return;
                mView.get().hideWaitDialog();
                mView.get().showToast(errMsg);
            }
        });
    }
}
